package parser.nodes;

// Statement = [Assignment | ProcedureCall | IfStatement | Print | WhileStatement | RepeatStatement ]

import codegen.CodeGen;

public class StatementNode extends Node {

    private Node statement;

    public StatementNode(Node statement) {
        this.statement = statement;
    }

    public StatementNode() {
    }

    @Override
    public void print() {
        p("Statement:");
        indent();
        if (statement != null) {
            statement.print();
        }
        unindent();
    }

    @Override
    public void abstractPrint() {
        if (statement != null) {
            statement.abstractPrint();
        }
    }

    @Override
    public void compile(CodeGen c) throws CompileError {
        if (statement != null)
            statement.compile(c);
    }
}
